
<!DOCTYPE html>

<html>
  
<!-- Mirrored from docs.sympy.org/latest/modules/series/sequences.html by HTTrack Website Copier/3.x [XR&CO'2014], Sat, 15 Jan 2022 03:29:07 GMT -->
<!-- Added by HTTrack --><meta http-equiv="content-type" content="text/html;charset=utf-8" /><!-- /Added by HTTrack -->
<head>
    <meta charset="utf-8" />
    <meta name="viewport" content="width=device-width, initial-scale=1.0" /><meta name="generator" content="Docutils 0.17.1: http://docutils.sourceforge.net/" />

    <title>Sequences &#8212; SymPy 1.9 documentation</title>
    <link rel="stylesheet" type="text/css" href="../../_static/pygments.css" />
    <link rel="stylesheet" type="text/css" href="../../_static/default.css" />
    <link rel="stylesheet" type="text/css" href="../../_static/graphviz.css" />
    <link rel="stylesheet" type="text/css" href="../../_static/plot_directive.css" />
    <link rel="stylesheet" type="text/css" href="../../../../live.sympy.org/static/live-core.css" />
    <link rel="stylesheet" type="text/css" href="../../../../live.sympy.org/static/live-autocomplete.css" />
    <link rel="stylesheet" type="text/css" href="../../../../live.sympy.org/static/live-sphinx.css" />
    
    <script data-url_root="../../" id="documentation_options" src="../../_static/documentation_options.js"></script>
    <script src="../../_static/jquery.js"></script>
    <script src="../../_static/underscore.js"></script>
    <script src="../../_static/doctools.js"></script>
    <script src="../../../../live.sympy.org/static/utilities.js"></script>
    <script src="../../../../live.sympy.org/static/external/classy.js"></script>
    <script src="../../../../live.sympy.org/static/live-core.js"></script>
    <script src="../../../../live.sympy.org/static/live-autocomplete.js"></script>
    <script src="../../../../live.sympy.org/static/live-sphinx.js"></script>
    <script async="async" src="../../../../cdnjs.cloudflare.com/ajax/libs/mathjax/2.7.5/latest8331.js?config=TeX-AMS_HTML-full"></script>
    <script type="text/x-mathjax-config">MathJax.Hub.Config({"tex2jax": {"inlineMath": [["\\(", "\\)"]], "displayMath": [["\\[", "\\]"]]}})</script>
    
    <link rel="shortcut icon" href="../../_static/sympy-notailtext-favicon.ico"/>
    <link href="sequences.html" rel="canonical" />
    
    <link rel="index" title="Index" href="../../genindex.html" />
    <link rel="search" title="Search" href="../../search.html" />
    <link rel="next" title="Fourier Series" href="fourier.html" />
    <link rel="prev" title="Series Expansions" href="series.html" /> 
  </head><body>
    <div class="related" role="navigation" aria-label="related navigation">
      <h3>Navigation</h3>
      <ul>
        <li class="right" style="margin-right: 10px">
          <a href="../../genindex.html" title="General Index"
             accesskey="I">index</a></li>
        <li class="right" >
          <a href="../../py-modindex.html" title="Python Module Index"
             >modules</a> |</li>
        <li class="right" >
          <a href="fourier.html" title="Fourier Series"
             accesskey="N">next</a> |</li>
        <li class="right" >
          <a href="series.html" title="Series Expansions"
             accesskey="P">previous</a> |</li>
        <li class="nav-item nav-item-0"><a href="../../index.html">SymPy 1.9 documentation</a> &#187;</li>
          <li class="nav-item nav-item-1"><a href="../index.html" >SymPy Modules Reference</a> &#187;</li>
          <li class="nav-item nav-item-2"><a href="index.html" accesskey="U">Series</a> &#187;</li>
        <li class="nav-item nav-item-this"><a href="#">Sequences</a></li> 
      </ul>
    </div>  

    <div class="document">
      <div class="documentwrapper">
        <div class="bodywrapper">
          <div class="body" role="main">
            
  <section id="sequences">
<h1>Sequences<a class="headerlink" href="#sequences" title="Permalink to this headline">¶</a></h1>
<p>A sequence is a finite or infinite lazily evaluated list.</p>
<dl class="py function">
<dt class="sig sig-object py" id="sympy.series.sequences.sequence">
<span class="sig-prename descclassname"><span class="pre">sympy.series.sequences.</span></span><span class="sig-name descname"><span class="pre">sequence</span></span><span class="sig-paren">(</span><em class="sig-param"><span class="n"><span class="pre">seq</span></span></em>, <em class="sig-param"><span class="n"><span class="pre">limits</span></span><span class="o"><span class="pre">=</span></span><span class="default_value"><span class="pre">None</span></span></em><span class="sig-paren">)</span><a class="reference external" href="https://github.com/sympy/sympy/blob/00d6469eafdd4aac346a0b598184c15f2560dbe5/sympy/series/sequences.py#L924-L955"><span class="viewcode-link"><span class="pre">[source]</span></span></a><a class="headerlink" href="#sympy.series.sequences.sequence" title="Permalink to this definition">¶</a></dt>
<dd><p>Returns appropriate sequence object.</p>
<p class="rubric">Explanation</p>
<p>If <code class="docutils literal notranslate"><span class="pre">seq</span></code> is a sympy sequence, returns <a class="reference internal" href="#sympy.series.sequences.SeqPer" title="sympy.series.sequences.SeqPer"><code class="xref py py-class docutils literal notranslate"><span class="pre">SeqPer</span></code></a> object
otherwise returns <a class="reference internal" href="#sympy.series.sequences.SeqFormula" title="sympy.series.sequences.SeqFormula"><code class="xref py py-class docutils literal notranslate"><span class="pre">SeqFormula</span></code></a> object.</p>
<p class="rubric">Examples</p>
<div class="doctest highlight-default notranslate"><div class="highlight"><pre><span></span><span class="gp">&gt;&gt;&gt; </span><span class="kn">from</span> <span class="nn">sympy</span> <span class="kn">import</span> <span class="n">sequence</span>
<span class="gp">&gt;&gt;&gt; </span><span class="kn">from</span> <span class="nn">sympy.abc</span> <span class="kn">import</span> <span class="n">n</span>
<span class="gp">&gt;&gt;&gt; </span><span class="n">sequence</span><span class="p">(</span><span class="n">n</span><span class="o">**</span><span class="mi">2</span><span class="p">,</span> <span class="p">(</span><span class="n">n</span><span class="p">,</span> <span class="mi">0</span><span class="p">,</span> <span class="mi">5</span><span class="p">))</span>
<span class="go">SeqFormula(n**2, (n, 0, 5))</span>
<span class="gp">&gt;&gt;&gt; </span><span class="n">sequence</span><span class="p">((</span><span class="mi">1</span><span class="p">,</span> <span class="mi">2</span><span class="p">,</span> <span class="mi">3</span><span class="p">),</span> <span class="p">(</span><span class="n">n</span><span class="p">,</span> <span class="mi">0</span><span class="p">,</span> <span class="mi">5</span><span class="p">))</span>
<span class="go">SeqPer((1, 2, 3), (n, 0, 5))</span>
</pre></div>
</div>
<div class="admonition seealso">
<p class="admonition-title">See also</p>
<p><a class="reference internal" href="#sympy.series.sequences.SeqPer" title="sympy.series.sequences.SeqPer"><code class="xref py py-obj docutils literal notranslate"><span class="pre">sympy.series.sequences.SeqPer</span></code></a>, <a class="reference internal" href="#sympy.series.sequences.SeqFormula" title="sympy.series.sequences.SeqFormula"><code class="xref py py-obj docutils literal notranslate"><span class="pre">sympy.series.sequences.SeqFormula</span></code></a></p>
</div>
</dd></dl>

<section id="sequences-base">
<h2>Sequences Base<a class="headerlink" href="#sequences-base" title="Permalink to this headline">¶</a></h2>
<dl class="py class">
<dt class="sig sig-object py" id="sympy.series.sequences.SeqBase">
<em class="property"><span class="pre">class</span> </em><span class="sig-prename descclassname"><span class="pre">sympy.series.sequences.</span></span><span class="sig-name descname"><span class="pre">SeqBase</span></span><span class="sig-paren">(</span><em class="sig-param"><span class="o"><span class="pre">*</span></span><span class="n"><span class="pre">args</span></span></em><span class="sig-paren">)</span><a class="reference external" href="https://github.com/sympy/sympy/blob/00d6469eafdd4aac346a0b598184c15f2560dbe5/sympy/series/sequences.py#L27-L378"><span class="viewcode-link"><span class="pre">[source]</span></span></a><a class="headerlink" href="#sympy.series.sequences.SeqBase" title="Permalink to this definition">¶</a></dt>
<dd><p>Base class for sequences</p>
<dl class="py method">
<dt class="sig sig-object py" id="sympy.series.sequences.SeqBase.coeff">
<span class="sig-name descname"><span class="pre">coeff</span></span><span class="sig-paren">(</span><em class="sig-param"><span class="n"><span class="pre">pt</span></span></em><span class="sig-paren">)</span><a class="reference external" href="https://github.com/sympy/sympy/blob/00d6469eafdd4aac346a0b598184c15f2560dbe5/sympy/series/sequences.py#L101-L106"><span class="viewcode-link"><span class="pre">[source]</span></span></a><a class="headerlink" href="#sympy.series.sequences.SeqBase.coeff" title="Permalink to this definition">¶</a></dt>
<dd><p>Returns the coefficient at point pt</p>
</dd></dl>

<dl class="py method">
<dt class="sig sig-object py" id="sympy.series.sequences.SeqBase.coeff_mul">
<span class="sig-name descname"><span class="pre">coeff_mul</span></span><span class="sig-paren">(</span><em class="sig-param"><span class="n"><span class="pre">other</span></span></em><span class="sig-paren">)</span><a class="reference external" href="https://github.com/sympy/sympy/blob/00d6469eafdd4aac346a0b598184c15f2560dbe5/sympy/series/sequences.py#L190-L208"><span class="viewcode-link"><span class="pre">[source]</span></span></a><a class="headerlink" href="#sympy.series.sequences.SeqBase.coeff_mul" title="Permalink to this definition">¶</a></dt>
<dd><p>Should be used when <code class="docutils literal notranslate"><span class="pre">other</span></code> is not a sequence. Should be
defined to define custom behaviour.</p>
<p class="rubric">Examples</p>
<div class="doctest highlight-default notranslate"><div class="highlight"><pre><span></span><span class="gp">&gt;&gt;&gt; </span><span class="kn">from</span> <span class="nn">sympy</span> <span class="kn">import</span> <span class="n">SeqFormula</span>
<span class="gp">&gt;&gt;&gt; </span><span class="kn">from</span> <span class="nn">sympy.abc</span> <span class="kn">import</span> <span class="n">n</span>
<span class="gp">&gt;&gt;&gt; </span><span class="n">SeqFormula</span><span class="p">(</span><span class="n">n</span><span class="o">**</span><span class="mi">2</span><span class="p">)</span><span class="o">.</span><span class="n">coeff_mul</span><span class="p">(</span><span class="mi">2</span><span class="p">)</span>
<span class="go">SeqFormula(2*n**2, (n, 0, oo))</span>
</pre></div>
</div>
<p class="rubric">Notes</p>
<p>‘*’ defines multiplication of sequences with sequences only.</p>
</dd></dl>

<dl class="py method">
<dt class="sig sig-object py" id="sympy.series.sequences.SeqBase.find_linear_recurrence">
<span class="sig-name descname"><span class="pre">find_linear_recurrence</span></span><span class="sig-paren">(</span><em class="sig-param"><span class="n"><span class="pre">n</span></span></em>, <em class="sig-param"><span class="n"><span class="pre">d</span></span><span class="o"><span class="pre">=</span></span><span class="default_value"><span class="pre">None</span></span></em>, <em class="sig-param"><span class="n"><span class="pre">gfvar</span></span><span class="o"><span class="pre">=</span></span><span class="default_value"><span class="pre">None</span></span></em><span class="sig-paren">)</span><a class="reference external" href="https://github.com/sympy/sympy/blob/00d6469eafdd4aac346a0b598184c15f2560dbe5/sympy/series/sequences.py#L305-L378"><span class="viewcode-link"><span class="pre">[source]</span></span></a><a class="headerlink" href="#sympy.series.sequences.SeqBase.find_linear_recurrence" title="Permalink to this definition">¶</a></dt>
<dd><p>Finds the shortest linear recurrence that satisfies the first n
terms of sequence of order <span class="math notranslate nohighlight">\(\leq\)</span> <code class="docutils literal notranslate"><span class="pre">n/2</span></code> if possible.
If <code class="docutils literal notranslate"><span class="pre">d</span></code> is specified, find shortest linear recurrence of order
<span class="math notranslate nohighlight">\(\leq\)</span> min(d, n/2) if possible.
Returns list of coefficients <code class="docutils literal notranslate"><span class="pre">[b(1),</span> <span class="pre">b(2),</span> <span class="pre">...]</span></code> corresponding to the
recurrence relation <code class="docutils literal notranslate"><span class="pre">x(n)</span> <span class="pre">=</span> <span class="pre">b(1)*x(n-1)</span> <span class="pre">+</span> <span class="pre">b(2)*x(n-2)</span> <span class="pre">+</span> <span class="pre">...</span></code>
Returns <code class="docutils literal notranslate"><span class="pre">[]</span></code> if no recurrence is found.
If gfvar is specified, also returns ordinary generating function as a
function of gfvar.</p>
<p class="rubric">Examples</p>
<div class="doctest highlight-default notranslate"><div class="highlight"><pre><span></span><span class="gp">&gt;&gt;&gt; </span><span class="kn">from</span> <span class="nn">sympy</span> <span class="kn">import</span> <span class="n">sequence</span><span class="p">,</span> <span class="n">sqrt</span><span class="p">,</span> <span class="n">oo</span><span class="p">,</span> <span class="n">lucas</span>
<span class="gp">&gt;&gt;&gt; </span><span class="kn">from</span> <span class="nn">sympy.abc</span> <span class="kn">import</span> <span class="n">n</span><span class="p">,</span> <span class="n">x</span><span class="p">,</span> <span class="n">y</span>
<span class="gp">&gt;&gt;&gt; </span><span class="n">sequence</span><span class="p">(</span><span class="n">n</span><span class="o">**</span><span class="mi">2</span><span class="p">)</span><span class="o">.</span><span class="n">find_linear_recurrence</span><span class="p">(</span><span class="mi">10</span><span class="p">,</span> <span class="mi">2</span><span class="p">)</span>
<span class="go">[]</span>
<span class="gp">&gt;&gt;&gt; </span><span class="n">sequence</span><span class="p">(</span><span class="n">n</span><span class="o">**</span><span class="mi">2</span><span class="p">)</span><span class="o">.</span><span class="n">find_linear_recurrence</span><span class="p">(</span><span class="mi">10</span><span class="p">)</span>
<span class="go">[3, -3, 1]</span>
<span class="gp">&gt;&gt;&gt; </span><span class="n">sequence</span><span class="p">(</span><span class="mi">2</span><span class="o">**</span><span class="n">n</span><span class="p">)</span><span class="o">.</span><span class="n">find_linear_recurrence</span><span class="p">(</span><span class="mi">10</span><span class="p">)</span>
<span class="go">[2]</span>
<span class="gp">&gt;&gt;&gt; </span><span class="n">sequence</span><span class="p">(</span><span class="mi">23</span><span class="o">*</span><span class="n">n</span><span class="o">**</span><span class="mi">4</span><span class="o">+</span><span class="mi">91</span><span class="o">*</span><span class="n">n</span><span class="o">**</span><span class="mi">2</span><span class="p">)</span><span class="o">.</span><span class="n">find_linear_recurrence</span><span class="p">(</span><span class="mi">10</span><span class="p">)</span>
<span class="go">[5, -10, 10, -5, 1]</span>
<span class="gp">&gt;&gt;&gt; </span><span class="n">sequence</span><span class="p">(</span><span class="n">sqrt</span><span class="p">(</span><span class="mi">5</span><span class="p">)</span><span class="o">*</span><span class="p">(((</span><span class="mi">1</span> <span class="o">+</span> <span class="n">sqrt</span><span class="p">(</span><span class="mi">5</span><span class="p">))</span><span class="o">/</span><span class="mi">2</span><span class="p">)</span><span class="o">**</span><span class="n">n</span> <span class="o">-</span> <span class="p">(</span><span class="o">-</span><span class="p">(</span><span class="mi">1</span> <span class="o">+</span> <span class="n">sqrt</span><span class="p">(</span><span class="mi">5</span><span class="p">))</span><span class="o">/</span><span class="mi">2</span><span class="p">)</span><span class="o">**</span><span class="p">(</span><span class="o">-</span><span class="n">n</span><span class="p">))</span><span class="o">/</span><span class="mi">5</span><span class="p">)</span><span class="o">.</span><span class="n">find_linear_recurrence</span><span class="p">(</span><span class="mi">10</span><span class="p">)</span>
<span class="go">[1, 1]</span>
<span class="gp">&gt;&gt;&gt; </span><span class="n">sequence</span><span class="p">(</span><span class="n">x</span><span class="o">+</span><span class="n">y</span><span class="o">*</span><span class="p">(</span><span class="o">-</span><span class="mi">2</span><span class="p">)</span><span class="o">**</span><span class="p">(</span><span class="o">-</span><span class="n">n</span><span class="p">),</span> <span class="p">(</span><span class="n">n</span><span class="p">,</span> <span class="mi">0</span><span class="p">,</span> <span class="n">oo</span><span class="p">))</span><span class="o">.</span><span class="n">find_linear_recurrence</span><span class="p">(</span><span class="mi">30</span><span class="p">)</span>
<span class="go">[1/2, 1/2]</span>
<span class="gp">&gt;&gt;&gt; </span><span class="n">sequence</span><span class="p">(</span><span class="mi">3</span><span class="o">*</span><span class="mi">5</span><span class="o">**</span><span class="n">n</span> <span class="o">+</span> <span class="mi">12</span><span class="p">)</span><span class="o">.</span><span class="n">find_linear_recurrence</span><span class="p">(</span><span class="mi">20</span><span class="p">,</span><span class="n">gfvar</span><span class="o">=</span><span class="n">x</span><span class="p">)</span>
<span class="go">([6, -5], 3*(5 - 21*x)/((x - 1)*(5*x - 1)))</span>
<span class="gp">&gt;&gt;&gt; </span><span class="n">sequence</span><span class="p">(</span><span class="n">lucas</span><span class="p">(</span><span class="n">n</span><span class="p">))</span><span class="o">.</span><span class="n">find_linear_recurrence</span><span class="p">(</span><span class="mi">15</span><span class="p">,</span><span class="n">gfvar</span><span class="o">=</span><span class="n">x</span><span class="p">)</span>
<span class="go">([1, 1], (x - 2)/(x**2 + x - 1))</span>
</pre></div>
</div>
</dd></dl>

<dl class="py property">
<dt class="sig sig-object py" id="sympy.series.sequences.SeqBase.free_symbols">
<em class="property"><span class="pre">property</span> </em><span class="sig-name descname"><span class="pre">free_symbols</span></span><a class="headerlink" href="#sympy.series.sequences.SeqBase.free_symbols" title="Permalink to this definition">¶</a></dt>
<dd><p>This method returns the symbols in the object, excluding those
that take on a specific value (i.e. the dummy symbols).</p>
<p class="rubric">Examples</p>
<div class="doctest highlight-default notranslate"><div class="highlight"><pre><span></span><span class="gp">&gt;&gt;&gt; </span><span class="kn">from</span> <span class="nn">sympy</span> <span class="kn">import</span> <span class="n">SeqFormula</span>
<span class="gp">&gt;&gt;&gt; </span><span class="kn">from</span> <span class="nn">sympy.abc</span> <span class="kn">import</span> <span class="n">n</span><span class="p">,</span> <span class="n">m</span>
<span class="gp">&gt;&gt;&gt; </span><span class="n">SeqFormula</span><span class="p">(</span><span class="n">m</span><span class="o">*</span><span class="n">n</span><span class="o">**</span><span class="mi">2</span><span class="p">,</span> <span class="p">(</span><span class="n">n</span><span class="p">,</span> <span class="mi">0</span><span class="p">,</span> <span class="mi">5</span><span class="p">))</span><span class="o">.</span><span class="n">free_symbols</span>
<span class="go">{m}</span>
</pre></div>
</div>
</dd></dl>

<dl class="py property">
<dt class="sig sig-object py" id="sympy.series.sequences.SeqBase.gen">
<em class="property"><span class="pre">property</span> </em><span class="sig-name descname"><span class="pre">gen</span></span><a class="headerlink" href="#sympy.series.sequences.SeqBase.gen" title="Permalink to this definition">¶</a></dt>
<dd><p>Returns the generator for the sequence</p>
</dd></dl>

<dl class="py property">
<dt class="sig sig-object py" id="sympy.series.sequences.SeqBase.interval">
<em class="property"><span class="pre">property</span> </em><span class="sig-name descname"><span class="pre">interval</span></span><a class="headerlink" href="#sympy.series.sequences.SeqBase.interval" title="Permalink to this definition">¶</a></dt>
<dd><p>The interval on which the sequence is defined</p>
</dd></dl>

<dl class="py property">
<dt class="sig sig-object py" id="sympy.series.sequences.SeqBase.length">
<em class="property"><span class="pre">property</span> </em><span class="sig-name descname"><span class="pre">length</span></span><a class="headerlink" href="#sympy.series.sequences.SeqBase.length" title="Permalink to this definition">¶</a></dt>
<dd><p>Length of the sequence</p>
</dd></dl>

<dl class="py property">
<dt class="sig sig-object py" id="sympy.series.sequences.SeqBase.start">
<em class="property"><span class="pre">property</span> </em><span class="sig-name descname"><span class="pre">start</span></span><a class="headerlink" href="#sympy.series.sequences.SeqBase.start" title="Permalink to this definition">¶</a></dt>
<dd><p>The starting point of the sequence. This point is included</p>
</dd></dl>

<dl class="py property">
<dt class="sig sig-object py" id="sympy.series.sequences.SeqBase.stop">
<em class="property"><span class="pre">property</span> </em><span class="sig-name descname"><span class="pre">stop</span></span><a class="headerlink" href="#sympy.series.sequences.SeqBase.stop" title="Permalink to this definition">¶</a></dt>
<dd><p>The ending point of the sequence. This point is included</p>
</dd></dl>

<dl class="py property">
<dt class="sig sig-object py" id="sympy.series.sequences.SeqBase.variables">
<em class="property"><span class="pre">property</span> </em><span class="sig-name descname"><span class="pre">variables</span></span><a class="headerlink" href="#sympy.series.sequences.SeqBase.variables" title="Permalink to this definition">¶</a></dt>
<dd><p>Returns a tuple of variables that are bounded</p>
</dd></dl>

</dd></dl>

</section>
<section id="elementary-sequences">
<h2>Elementary Sequences<a class="headerlink" href="#elementary-sequences" title="Permalink to this headline">¶</a></h2>
<dl class="py class">
<dt class="sig sig-object py" id="sympy.series.sequences.SeqFormula">
<em class="property"><span class="pre">class</span> </em><span class="sig-prename descclassname"><span class="pre">sympy.series.sequences.</span></span><span class="sig-name descname"><span class="pre">SeqFormula</span></span><span class="sig-paren">(</span><em class="sig-param"><span class="n"><span class="pre">formula</span></span></em>, <em class="sig-param"><span class="n"><span class="pre">limits</span></span><span class="o"><span class="pre">=</span></span><span class="default_value"><span class="pre">None</span></span></em><span class="sig-paren">)</span><a class="reference external" href="https://github.com/sympy/sympy/blob/00d6469eafdd4aac346a0b598184c15f2560dbe5/sympy/series/sequences.py#L612-L725"><span class="viewcode-link"><span class="pre">[source]</span></span></a><a class="headerlink" href="#sympy.series.sequences.SeqFormula" title="Permalink to this definition">¶</a></dt>
<dd><p>Represents sequence based on a formula.</p>
<p>Elements are generated using a formula.</p>
<p class="rubric">Examples</p>
<div class="doctest highlight-default notranslate"><div class="highlight"><pre><span></span><span class="gp">&gt;&gt;&gt; </span><span class="kn">from</span> <span class="nn">sympy</span> <span class="kn">import</span> <span class="n">SeqFormula</span><span class="p">,</span> <span class="n">oo</span><span class="p">,</span> <span class="n">Symbol</span>
<span class="gp">&gt;&gt;&gt; </span><span class="n">n</span> <span class="o">=</span> <span class="n">Symbol</span><span class="p">(</span><span class="s1">&#39;n&#39;</span><span class="p">)</span>
<span class="gp">&gt;&gt;&gt; </span><span class="n">s</span> <span class="o">=</span> <span class="n">SeqFormula</span><span class="p">(</span><span class="n">n</span><span class="o">**</span><span class="mi">2</span><span class="p">,</span> <span class="p">(</span><span class="n">n</span><span class="p">,</span> <span class="mi">0</span><span class="p">,</span> <span class="mi">5</span><span class="p">))</span>
<span class="gp">&gt;&gt;&gt; </span><span class="n">s</span><span class="o">.</span><span class="n">formula</span>
<span class="go">n**2</span>
</pre></div>
</div>
<p>For value at a particular point</p>
<div class="doctest highlight-default notranslate"><div class="highlight"><pre><span></span><span class="gp">&gt;&gt;&gt; </span><span class="n">s</span><span class="o">.</span><span class="n">coeff</span><span class="p">(</span><span class="mi">3</span><span class="p">)</span>
<span class="go">9</span>
</pre></div>
</div>
<p>supports slicing</p>
<div class="doctest highlight-default notranslate"><div class="highlight"><pre><span></span><span class="gp">&gt;&gt;&gt; </span><span class="n">s</span><span class="p">[:]</span>
<span class="go">[0, 1, 4, 9, 16, 25]</span>
</pre></div>
</div>
<p>iterable</p>
<div class="doctest highlight-default notranslate"><div class="highlight"><pre><span></span><span class="gp">&gt;&gt;&gt; </span><span class="nb">list</span><span class="p">(</span><span class="n">s</span><span class="p">)</span>
<span class="go">[0, 1, 4, 9, 16, 25]</span>
</pre></div>
</div>
<p>sequence starts from negative infinity</p>
<div class="doctest highlight-default notranslate"><div class="highlight"><pre><span></span><span class="gp">&gt;&gt;&gt; </span><span class="n">SeqFormula</span><span class="p">(</span><span class="n">n</span><span class="o">**</span><span class="mi">2</span><span class="p">,</span> <span class="p">(</span><span class="o">-</span><span class="n">oo</span><span class="p">,</span> <span class="mi">0</span><span class="p">))[</span><span class="mi">0</span><span class="p">:</span><span class="mi">6</span><span class="p">]</span>
<span class="go">[0, 1, 4, 9, 16, 25]</span>
</pre></div>
</div>
<div class="admonition seealso">
<p class="admonition-title">See also</p>
<p><a class="reference internal" href="#sympy.series.sequences.SeqPer" title="sympy.series.sequences.SeqPer"><code class="xref py py-obj docutils literal notranslate"><span class="pre">sympy.series.sequences.SeqPer</span></code></a></p>
</div>
<dl class="py method">
<dt class="sig sig-object py" id="sympy.series.sequences.SeqFormula.coeff_mul">
<span class="sig-name descname"><span class="pre">coeff_mul</span></span><span class="sig-paren">(</span><em class="sig-param"><span class="n"><span class="pre">coeff</span></span></em><span class="sig-paren">)</span><a class="reference external" href="https://github.com/sympy/sympy/blob/00d6469eafdd4aac346a0b598184c15f2560dbe5/sympy/series/sequences.py#L718-L722"><span class="viewcode-link"><span class="pre">[source]</span></span></a><a class="headerlink" href="#sympy.series.sequences.SeqFormula.coeff_mul" title="Permalink to this definition">¶</a></dt>
<dd><p>See docstring of SeqBase.coeff_mul</p>
</dd></dl>

</dd></dl>

<dl class="py class">
<dt class="sig sig-object py" id="sympy.series.sequences.SeqPer">
<em class="property"><span class="pre">class</span> </em><span class="sig-prename descclassname"><span class="pre">sympy.series.sequences.</span></span><span class="sig-name descname"><span class="pre">SeqPer</span></span><span class="sig-paren">(</span><em class="sig-param"><span class="n"><span class="pre">periodical</span></span></em>, <em class="sig-param"><span class="n"><span class="pre">limits</span></span><span class="o"><span class="pre">=</span></span><span class="default_value"><span class="pre">None</span></span></em><span class="sig-paren">)</span><a class="reference external" href="https://github.com/sympy/sympy/blob/00d6469eafdd4aac346a0b598184c15f2560dbe5/sympy/series/sequences.py#L467-L609"><span class="viewcode-link"><span class="pre">[source]</span></span></a><a class="headerlink" href="#sympy.series.sequences.SeqPer" title="Permalink to this definition">¶</a></dt>
<dd><p>Represents a periodic sequence.</p>
<p>The elements are repeated after a given period.</p>
<p class="rubric">Examples</p>
<div class="doctest highlight-default notranslate"><div class="highlight"><pre><span></span><span class="gp">&gt;&gt;&gt; </span><span class="kn">from</span> <span class="nn">sympy</span> <span class="kn">import</span> <span class="n">SeqPer</span><span class="p">,</span> <span class="n">oo</span>
<span class="gp">&gt;&gt;&gt; </span><span class="kn">from</span> <span class="nn">sympy.abc</span> <span class="kn">import</span> <span class="n">k</span>
</pre></div>
</div>
<div class="doctest highlight-default notranslate"><div class="highlight"><pre><span></span><span class="gp">&gt;&gt;&gt; </span><span class="n">s</span> <span class="o">=</span> <span class="n">SeqPer</span><span class="p">((</span><span class="mi">1</span><span class="p">,</span> <span class="mi">2</span><span class="p">,</span> <span class="mi">3</span><span class="p">),</span> <span class="p">(</span><span class="mi">0</span><span class="p">,</span> <span class="mi">5</span><span class="p">))</span>
<span class="gp">&gt;&gt;&gt; </span><span class="n">s</span><span class="o">.</span><span class="n">periodical</span>
<span class="go">(1, 2, 3)</span>
<span class="gp">&gt;&gt;&gt; </span><span class="n">s</span><span class="o">.</span><span class="n">period</span>
<span class="go">3</span>
</pre></div>
</div>
<p>For value at a particular point</p>
<div class="doctest highlight-default notranslate"><div class="highlight"><pre><span></span><span class="gp">&gt;&gt;&gt; </span><span class="n">s</span><span class="o">.</span><span class="n">coeff</span><span class="p">(</span><span class="mi">3</span><span class="p">)</span>
<span class="go">1</span>
</pre></div>
</div>
<p>supports slicing</p>
<div class="doctest highlight-default notranslate"><div class="highlight"><pre><span></span><span class="gp">&gt;&gt;&gt; </span><span class="n">s</span><span class="p">[:]</span>
<span class="go">[1, 2, 3, 1, 2, 3]</span>
</pre></div>
</div>
<p>iterable</p>
<div class="doctest highlight-default notranslate"><div class="highlight"><pre><span></span><span class="gp">&gt;&gt;&gt; </span><span class="nb">list</span><span class="p">(</span><span class="n">s</span><span class="p">)</span>
<span class="go">[1, 2, 3, 1, 2, 3]</span>
</pre></div>
</div>
<p>sequence starts from negative infinity</p>
<div class="doctest highlight-default notranslate"><div class="highlight"><pre><span></span><span class="gp">&gt;&gt;&gt; </span><span class="n">SeqPer</span><span class="p">((</span><span class="mi">1</span><span class="p">,</span> <span class="mi">2</span><span class="p">,</span> <span class="mi">3</span><span class="p">),</span> <span class="p">(</span><span class="o">-</span><span class="n">oo</span><span class="p">,</span> <span class="mi">0</span><span class="p">))[</span><span class="mi">0</span><span class="p">:</span><span class="mi">6</span><span class="p">]</span>
<span class="go">[1, 2, 3, 1, 2, 3]</span>
</pre></div>
</div>
<p>Periodic formulas</p>
<div class="doctest highlight-default notranslate"><div class="highlight"><pre><span></span><span class="gp">&gt;&gt;&gt; </span><span class="n">SeqPer</span><span class="p">((</span><span class="n">k</span><span class="p">,</span> <span class="n">k</span><span class="o">**</span><span class="mi">2</span><span class="p">,</span> <span class="n">k</span><span class="o">**</span><span class="mi">3</span><span class="p">),</span> <span class="p">(</span><span class="n">k</span><span class="p">,</span> <span class="mi">0</span><span class="p">,</span> <span class="n">oo</span><span class="p">))[</span><span class="mi">0</span><span class="p">:</span><span class="mi">6</span><span class="p">]</span>
<span class="go">[0, 1, 8, 3, 16, 125]</span>
</pre></div>
</div>
<div class="admonition seealso">
<p class="admonition-title">See also</p>
<p><a class="reference internal" href="#sympy.series.sequences.SeqFormula" title="sympy.series.sequences.SeqFormula"><code class="xref py py-obj docutils literal notranslate"><span class="pre">sympy.series.sequences.SeqFormula</span></code></a></p>
</div>
<dl class="py method">
<dt class="sig sig-object py" id="sympy.series.sequences.SeqPer.coeff_mul">
<span class="sig-name descname"><span class="pre">coeff_mul</span></span><span class="sig-paren">(</span><em class="sig-param"><span class="n"><span class="pre">coeff</span></span></em><span class="sig-paren">)</span><a class="reference external" href="https://github.com/sympy/sympy/blob/00d6469eafdd4aac346a0b598184c15f2560dbe5/sympy/series/sequences.py#L605-L609"><span class="viewcode-link"><span class="pre">[source]</span></span></a><a class="headerlink" href="#sympy.series.sequences.SeqPer.coeff_mul" title="Permalink to this definition">¶</a></dt>
<dd><p>See docstring of SeqBase.coeff_mul</p>
</dd></dl>

</dd></dl>

</section>
<section id="singleton-sequences">
<h2>Singleton Sequences<a class="headerlink" href="#singleton-sequences" title="Permalink to this headline">¶</a></h2>
<dl class="py class">
<dt class="sig sig-object py" id="sympy.series.sequences.EmptySequence">
<em class="property"><span class="pre">class</span> </em><span class="sig-prename descclassname"><span class="pre">sympy.series.sequences.</span></span><span class="sig-name descname"><span class="pre">EmptySequence</span></span><a class="reference external" href="https://github.com/sympy/sympy/blob/00d6469eafdd4aac346a0b598184c15f2560dbe5/sympy/series/sequences.py#L380-L414"><span class="viewcode-link"><span class="pre">[source]</span></span></a><a class="headerlink" href="#sympy.series.sequences.EmptySequence" title="Permalink to this definition">¶</a></dt>
<dd><p>Represents an empty sequence.</p>
<p>The empty sequence is also available as a singleton as
<code class="docutils literal notranslate"><span class="pre">S.EmptySequence</span></code>.</p>
<p class="rubric">Examples</p>
<div class="doctest highlight-default notranslate"><div class="highlight"><pre><span></span><span class="gp">&gt;&gt;&gt; </span><span class="kn">from</span> <span class="nn">sympy</span> <span class="kn">import</span> <span class="n">EmptySequence</span><span class="p">,</span> <span class="n">SeqPer</span>
<span class="gp">&gt;&gt;&gt; </span><span class="kn">from</span> <span class="nn">sympy.abc</span> <span class="kn">import</span> <span class="n">x</span>
<span class="gp">&gt;&gt;&gt; </span><span class="n">EmptySequence</span>
<span class="go">EmptySequence</span>
<span class="gp">&gt;&gt;&gt; </span><span class="n">SeqPer</span><span class="p">((</span><span class="mi">1</span><span class="p">,</span> <span class="mi">2</span><span class="p">),</span> <span class="p">(</span><span class="n">x</span><span class="p">,</span> <span class="mi">0</span><span class="p">,</span> <span class="mi">10</span><span class="p">))</span> <span class="o">+</span> <span class="n">EmptySequence</span>
<span class="go">SeqPer((1, 2), (x, 0, 10))</span>
<span class="gp">&gt;&gt;&gt; </span><span class="n">SeqPer</span><span class="p">((</span><span class="mi">1</span><span class="p">,</span> <span class="mi">2</span><span class="p">))</span> <span class="o">*</span> <span class="n">EmptySequence</span>
<span class="go">EmptySequence</span>
<span class="gp">&gt;&gt;&gt; </span><span class="n">EmptySequence</span><span class="o">.</span><span class="n">coeff_mul</span><span class="p">(</span><span class="o">-</span><span class="mi">1</span><span class="p">)</span>
<span class="go">EmptySequence</span>
</pre></div>
</div>
<dl class="py method">
<dt class="sig sig-object py" id="sympy.series.sequences.EmptySequence.coeff_mul">
<span class="sig-name descname"><span class="pre">coeff_mul</span></span><span class="sig-paren">(</span><em class="sig-param"><span class="n"><span class="pre">coeff</span></span></em><span class="sig-paren">)</span><a class="reference external" href="https://github.com/sympy/sympy/blob/00d6469eafdd4aac346a0b598184c15f2560dbe5/sympy/series/sequences.py#L409-L411"><span class="viewcode-link"><span class="pre">[source]</span></span></a><a class="headerlink" href="#sympy.series.sequences.EmptySequence.coeff_mul" title="Permalink to this definition">¶</a></dt>
<dd><p>See docstring of SeqBase.coeff_mul</p>
</dd></dl>

</dd></dl>

</section>
<section id="compound-sequences">
<h2>Compound Sequences<a class="headerlink" href="#compound-sequences" title="Permalink to this headline">¶</a></h2>
<dl class="py class">
<dt class="sig sig-object py" id="sympy.series.sequences.SeqAdd">
<em class="property"><span class="pre">class</span> </em><span class="sig-prename descclassname"><span class="pre">sympy.series.sequences.</span></span><span class="sig-name descname"><span class="pre">SeqAdd</span></span><span class="sig-paren">(</span><em class="sig-param"><span class="o"><span class="pre">*</span></span><span class="n"><span class="pre">args</span></span></em>, <em class="sig-param"><span class="o"><span class="pre">**</span></span><span class="n"><span class="pre">kwargs</span></span></em><span class="sig-paren">)</span><a class="reference external" href="https://github.com/sympy/sympy/blob/00d6469eafdd4aac346a0b598184c15f2560dbe5/sympy/series/sequences.py#L1021-L1124"><span class="viewcode-link"><span class="pre">[source]</span></span></a><a class="headerlink" href="#sympy.series.sequences.SeqAdd" title="Permalink to this definition">¶</a></dt>
<dd><p>Represents term-wise addition of sequences.</p>
<dl class="simple">
<dt>Rules:</dt><dd><ul class="simple">
<li><p>The interval on which sequence is defined is the intersection
of respective intervals of sequences.</p></li>
<li><p>Anything + <a class="reference internal" href="#sympy.series.sequences.EmptySequence" title="sympy.series.sequences.EmptySequence"><code class="xref py py-class docutils literal notranslate"><span class="pre">EmptySequence</span></code></a> remains unchanged.</p></li>
<li><p>Other rules are defined in <code class="docutils literal notranslate"><span class="pre">_add</span></code> methods of sequence classes.</p></li>
</ul>
</dd>
</dl>
<p class="rubric">Examples</p>
<div class="doctest highlight-default notranslate"><div class="highlight"><pre><span></span><span class="gp">&gt;&gt;&gt; </span><span class="kn">from</span> <span class="nn">sympy</span> <span class="kn">import</span> <span class="n">EmptySequence</span><span class="p">,</span> <span class="n">oo</span><span class="p">,</span> <span class="n">SeqAdd</span><span class="p">,</span> <span class="n">SeqPer</span><span class="p">,</span> <span class="n">SeqFormula</span>
<span class="gp">&gt;&gt;&gt; </span><span class="kn">from</span> <span class="nn">sympy.abc</span> <span class="kn">import</span> <span class="n">n</span>
<span class="gp">&gt;&gt;&gt; </span><span class="n">SeqAdd</span><span class="p">(</span><span class="n">SeqPer</span><span class="p">((</span><span class="mi">1</span><span class="p">,</span> <span class="mi">2</span><span class="p">),</span> <span class="p">(</span><span class="n">n</span><span class="p">,</span> <span class="mi">0</span><span class="p">,</span> <span class="n">oo</span><span class="p">)),</span> <span class="n">EmptySequence</span><span class="p">)</span>
<span class="go">SeqPer((1, 2), (n, 0, oo))</span>
<span class="gp">&gt;&gt;&gt; </span><span class="n">SeqAdd</span><span class="p">(</span><span class="n">SeqPer</span><span class="p">((</span><span class="mi">1</span><span class="p">,</span> <span class="mi">2</span><span class="p">),</span> <span class="p">(</span><span class="n">n</span><span class="p">,</span> <span class="mi">0</span><span class="p">,</span> <span class="mi">5</span><span class="p">)),</span> <span class="n">SeqPer</span><span class="p">((</span><span class="mi">1</span><span class="p">,</span> <span class="mi">2</span><span class="p">),</span> <span class="p">(</span><span class="n">n</span><span class="p">,</span> <span class="mi">6</span><span class="p">,</span> <span class="mi">10</span><span class="p">)))</span>
<span class="go">EmptySequence</span>
<span class="gp">&gt;&gt;&gt; </span><span class="n">SeqAdd</span><span class="p">(</span><span class="n">SeqPer</span><span class="p">((</span><span class="mi">1</span><span class="p">,</span> <span class="mi">2</span><span class="p">),</span> <span class="p">(</span><span class="n">n</span><span class="p">,</span> <span class="mi">0</span><span class="p">,</span> <span class="n">oo</span><span class="p">)),</span> <span class="n">SeqFormula</span><span class="p">(</span><span class="n">n</span><span class="o">**</span><span class="mi">2</span><span class="p">,</span> <span class="p">(</span><span class="n">n</span><span class="p">,</span> <span class="mi">0</span><span class="p">,</span> <span class="n">oo</span><span class="p">)))</span>
<span class="go">SeqAdd(SeqFormula(n**2, (n, 0, oo)), SeqPer((1, 2), (n, 0, oo)))</span>
<span class="gp">&gt;&gt;&gt; </span><span class="n">SeqAdd</span><span class="p">(</span><span class="n">SeqFormula</span><span class="p">(</span><span class="n">n</span><span class="o">**</span><span class="mi">3</span><span class="p">),</span> <span class="n">SeqFormula</span><span class="p">(</span><span class="n">n</span><span class="o">**</span><span class="mi">2</span><span class="p">))</span>
<span class="go">SeqFormula(n**3 + n**2, (n, 0, oo))</span>
</pre></div>
</div>
<div class="admonition seealso">
<p class="admonition-title">See also</p>
<p><a class="reference internal" href="#sympy.series.sequences.SeqMul" title="sympy.series.sequences.SeqMul"><code class="xref py py-obj docutils literal notranslate"><span class="pre">sympy.series.sequences.SeqMul</span></code></a></p>
</div>
<dl class="py method">
<dt class="sig sig-object py" id="sympy.series.sequences.SeqAdd.reduce">
<em class="property"><span class="pre">static</span> </em><span class="sig-name descname"><span class="pre">reduce</span></span><span class="sig-paren">(</span><em class="sig-param"><span class="n"><span class="pre">args</span></span></em><span class="sig-paren">)</span><a class="reference external" href="https://github.com/sympy/sympy/blob/00d6469eafdd4aac346a0b598184c15f2560dbe5/sympy/series/sequences.py#L1086-L1120"><span class="viewcode-link"><span class="pre">[source]</span></span></a><a class="headerlink" href="#sympy.series.sequences.SeqAdd.reduce" title="Permalink to this definition">¶</a></dt>
<dd><p>Simplify <a class="reference internal" href="#sympy.series.sequences.SeqAdd" title="sympy.series.sequences.SeqAdd"><code class="xref py py-class docutils literal notranslate"><span class="pre">SeqAdd</span></code></a> using known rules.</p>
<p>Iterates through all pairs and ask the constituent
sequences if they can simplify themselves with any other constituent.</p>
<p class="rubric">Notes</p>
<p>adapted from <code class="docutils literal notranslate"><span class="pre">Union.reduce</span></code></p>
</dd></dl>

</dd></dl>

<dl class="py class">
<dt class="sig sig-object py" id="sympy.series.sequences.SeqMul">
<em class="property"><span class="pre">class</span> </em><span class="sig-prename descclassname"><span class="pre">sympy.series.sequences.</span></span><span class="sig-name descname"><span class="pre">SeqMul</span></span><span class="sig-paren">(</span><em class="sig-param"><span class="o"><span class="pre">*</span></span><span class="n"><span class="pre">args</span></span></em>, <em class="sig-param"><span class="o"><span class="pre">**</span></span><span class="n"><span class="pre">kwargs</span></span></em><span class="sig-paren">)</span><a class="reference external" href="https://github.com/sympy/sympy/blob/00d6469eafdd4aac346a0b598184c15f2560dbe5/sympy/series/sequences.py#L1127-L1240"><span class="viewcode-link"><span class="pre">[source]</span></span></a><a class="headerlink" href="#sympy.series.sequences.SeqMul" title="Permalink to this definition">¶</a></dt>
<dd><p>Represents term-wise multiplication of sequences.</p>
<p class="rubric">Explanation</p>
<p>Handles multiplication of sequences only. For multiplication
with other objects see <a class="reference internal" href="#sympy.series.sequences.SeqBase.coeff_mul" title="sympy.series.sequences.SeqBase.coeff_mul"><code class="xref py py-func docutils literal notranslate"><span class="pre">SeqBase.coeff_mul()</span></code></a>.</p>
<dl class="simple">
<dt>Rules:</dt><dd><ul class="simple">
<li><p>The interval on which sequence is defined is the intersection
of respective intervals of sequences.</p></li>
<li><p>Anything * <a class="reference internal" href="#sympy.series.sequences.EmptySequence" title="sympy.series.sequences.EmptySequence"><code class="xref py py-class docutils literal notranslate"><span class="pre">EmptySequence</span></code></a> returns <a class="reference internal" href="#sympy.series.sequences.EmptySequence" title="sympy.series.sequences.EmptySequence"><code class="xref py py-class docutils literal notranslate"><span class="pre">EmptySequence</span></code></a>.</p></li>
<li><p>Other rules are defined in <code class="docutils literal notranslate"><span class="pre">_mul</span></code> methods of sequence classes.</p></li>
</ul>
</dd>
</dl>
<p class="rubric">Examples</p>
<div class="doctest highlight-default notranslate"><div class="highlight"><pre><span></span><span class="gp">&gt;&gt;&gt; </span><span class="kn">from</span> <span class="nn">sympy</span> <span class="kn">import</span> <span class="n">EmptySequence</span><span class="p">,</span> <span class="n">oo</span><span class="p">,</span> <span class="n">SeqMul</span><span class="p">,</span> <span class="n">SeqPer</span><span class="p">,</span> <span class="n">SeqFormula</span>
<span class="gp">&gt;&gt;&gt; </span><span class="kn">from</span> <span class="nn">sympy.abc</span> <span class="kn">import</span> <span class="n">n</span>
<span class="gp">&gt;&gt;&gt; </span><span class="n">SeqMul</span><span class="p">(</span><span class="n">SeqPer</span><span class="p">((</span><span class="mi">1</span><span class="p">,</span> <span class="mi">2</span><span class="p">),</span> <span class="p">(</span><span class="n">n</span><span class="p">,</span> <span class="mi">0</span><span class="p">,</span> <span class="n">oo</span><span class="p">)),</span> <span class="n">EmptySequence</span><span class="p">)</span>
<span class="go">EmptySequence</span>
<span class="gp">&gt;&gt;&gt; </span><span class="n">SeqMul</span><span class="p">(</span><span class="n">SeqPer</span><span class="p">((</span><span class="mi">1</span><span class="p">,</span> <span class="mi">2</span><span class="p">),</span> <span class="p">(</span><span class="n">n</span><span class="p">,</span> <span class="mi">0</span><span class="p">,</span> <span class="mi">5</span><span class="p">)),</span> <span class="n">SeqPer</span><span class="p">((</span><span class="mi">1</span><span class="p">,</span> <span class="mi">2</span><span class="p">),</span> <span class="p">(</span><span class="n">n</span><span class="p">,</span> <span class="mi">6</span><span class="p">,</span> <span class="mi">10</span><span class="p">)))</span>
<span class="go">EmptySequence</span>
<span class="gp">&gt;&gt;&gt; </span><span class="n">SeqMul</span><span class="p">(</span><span class="n">SeqPer</span><span class="p">((</span><span class="mi">1</span><span class="p">,</span> <span class="mi">2</span><span class="p">),</span> <span class="p">(</span><span class="n">n</span><span class="p">,</span> <span class="mi">0</span><span class="p">,</span> <span class="n">oo</span><span class="p">)),</span> <span class="n">SeqFormula</span><span class="p">(</span><span class="n">n</span><span class="o">**</span><span class="mi">2</span><span class="p">))</span>
<span class="go">SeqMul(SeqFormula(n**2, (n, 0, oo)), SeqPer((1, 2), (n, 0, oo)))</span>
<span class="gp">&gt;&gt;&gt; </span><span class="n">SeqMul</span><span class="p">(</span><span class="n">SeqFormula</span><span class="p">(</span><span class="n">n</span><span class="o">**</span><span class="mi">3</span><span class="p">),</span> <span class="n">SeqFormula</span><span class="p">(</span><span class="n">n</span><span class="o">**</span><span class="mi">2</span><span class="p">))</span>
<span class="go">SeqFormula(n**5, (n, 0, oo))</span>
</pre></div>
</div>
<div class="admonition seealso">
<p class="admonition-title">See also</p>
<p><a class="reference internal" href="#sympy.series.sequences.SeqAdd" title="sympy.series.sequences.SeqAdd"><code class="xref py py-obj docutils literal notranslate"><span class="pre">sympy.series.sequences.SeqAdd</span></code></a></p>
</div>
<dl class="py method">
<dt class="sig sig-object py" id="sympy.series.sequences.SeqMul.reduce">
<em class="property"><span class="pre">static</span> </em><span class="sig-name descname"><span class="pre">reduce</span></span><span class="sig-paren">(</span><em class="sig-param"><span class="n"><span class="pre">args</span></span></em><span class="sig-paren">)</span><a class="reference external" href="https://github.com/sympy/sympy/blob/00d6469eafdd4aac346a0b598184c15f2560dbe5/sympy/series/sequences.py#L1196-L1233"><span class="viewcode-link"><span class="pre">[source]</span></span></a><a class="headerlink" href="#sympy.series.sequences.SeqMul.reduce" title="Permalink to this definition">¶</a></dt>
<dd><p>Simplify a <a class="reference internal" href="#sympy.series.sequences.SeqMul" title="sympy.series.sequences.SeqMul"><code class="xref py py-class docutils literal notranslate"><span class="pre">SeqMul</span></code></a> using known rules.</p>
<p class="rubric">Explanation</p>
<p>Iterates through all pairs and ask the constituent
sequences if they can simplify themselves with any other constituent.</p>
<p class="rubric">Notes</p>
<p>adapted from <code class="docutils literal notranslate"><span class="pre">Union.reduce</span></code></p>
</dd></dl>

</dd></dl>

</section>
</section>


            <div class="clearer"></div>
          </div>
        </div>
      </div>
      <div class="sphinxsidebar" role="navigation" aria-label="main navigation">
        <div class="sphinxsidebarwrapper">
            <p class="logo"><a href="../../index.html">
              <img class="logo" src="../../_static/sympylogo.png" alt="Logo"/>
            </a></p>
  <h3><a href="../../index.html">Table of Contents</a></h3>
  <ul>
<li><a class="reference internal" href="#">Sequences</a><ul>
<li><a class="reference internal" href="#sequences-base">Sequences Base</a></li>
<li><a class="reference internal" href="#elementary-sequences">Elementary Sequences</a></li>
<li><a class="reference internal" href="#singleton-sequences">Singleton Sequences</a></li>
<li><a class="reference internal" href="#compound-sequences">Compound Sequences</a></li>
</ul>
</li>
</ul>

  <h4>Previous topic</h4>
  <p class="topless"><a href="series.html"
                        title="previous chapter">Series Expansions</a></p>
  <h4>Next topic</h4>
  <p class="topless"><a href="fourier.html"
                        title="next chapter">Fourier Series</a></p>
  <div role="note" aria-label="source link">
    <h3>This Page</h3>
    <ul class="this-page-menu">
      <li><a href="../../_sources/modules/series/sequences.rst.txt"
            rel="nofollow">Show Source</a></li>
    </ul>
   </div>
<div id="searchbox" style="display: none" role="search">
  <h3 id="searchlabel">Quick search</h3>
    <div class="searchformwrapper">
    <form class="search" action="https://docs.sympy.org/latest/search.html" method="get">
      <input type="text" name="q" aria-labelledby="searchlabel" autocomplete="off" autocorrect="off" autocapitalize="off" spellcheck="false"/>
      <input type="submit" value="Go" />
    </form>
    </div>
</div>
<script>$('#searchbox').show(0);</script>
        </div>
      </div>
      <div class="clearer"></div>
    </div>
    <div class="related" role="navigation" aria-label="related navigation">
      <h3>Navigation</h3>
      <ul>
        <li class="right" style="margin-right: 10px">
          <a href="../../genindex.html" title="General Index"
             >index</a></li>
        <li class="right" >
          <a href="../../py-modindex.html" title="Python Module Index"
             >modules</a> |</li>
        <li class="right" >
          <a href="fourier.html" title="Fourier Series"
             >next</a> |</li>
        <li class="right" >
          <a href="series.html" title="Series Expansions"
             >previous</a> |</li>
        <li class="nav-item nav-item-0"><a href="../../index.html">SymPy 1.9 documentation</a> &#187;</li>
          <li class="nav-item nav-item-1"><a href="../index.html" >SymPy Modules Reference</a> &#187;</li>
          <li class="nav-item nav-item-2"><a href="index.html" >Series</a> &#187;</li>
        <li class="nav-item nav-item-this"><a href="#">Sequences</a></li> 
      </ul>
    </div>
    <div class="footer" role="contentinfo">
        &#169; Copyright 2021 SymPy Development Team.
      Last updated on Sep 30, 2021.
      Created using <a href="https://www.sphinx-doc.org/">Sphinx</a> 4.1.2.
    </div>
  </body>

<!-- Mirrored from docs.sympy.org/latest/modules/series/sequences.html by HTTrack Website Copier/3.x [XR&CO'2014], Sat, 15 Jan 2022 03:29:07 GMT -->
</html>